﻿<%@ Page Language="C#" MasterPageFile="~/Masterpage/CommonPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Portal_News_Default"%>
<%@ Register Assembly="Masq.Components.BoxUIControls" Namespace="Masq.Components.BoxUIControls"  TagPrefix="Box" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<!--pagenav-->
<div class="pagenav"><strong>您现在的位置：</strong> 我的管理平台 > 新闻管理</div>
<div class="searchpanel">
    <div class="searchpanelheader">
        <div class="searchpaneltitle"><img id="searchPanelImage" name="searchPanelImage" src="<%=ResolveThemeImagePath("searchpanelminus.jpg")%>" width="11" height="11" border="0" alt="" align="absmiddle" onclick="javascript:SwitchSearchPanel('searchPanelContent', this);" />&nbsp;搜索</div>
    </div>
    <div class="searchpanelcontent" id="searchPanelContent" name="searchPanelContent">
        <table cellspacing="0">
            <tr>                
                <td>新闻标题：</td>
                <td>
                    <asp:TextBox ID="txt_title" MaxLength="40" runat="server" CssClass="txtBox" Width="130" />
                </td>
            </tr>
            <tr>
                <td>创建时间：</td>
                <td>
                    <asp:TextBox id="txt_BeginDate" MaxLength="40" runat="Server" CssClass="txtBox" Width="80" />&nbsp;--
                    <asp:TextBox id="txt_EndDate" MaxLength="40" runat="Server" CssClass="txtBox" Width="80" />&nbsp;
                </td>
            </tr>
            <tr>
                <td>新闻类别：</td>
                <td>
                <asp:DropDownList ID="ddl_newsType" runat="server" Width="138">
                    <asp:ListItem Value="0">全部新闻</asp:ListItem>
                    <asp:ListItem Value="1">慈溪社区快讯</asp:ListItem>
                    <%--<asp:ListItem Value="2">培训动态</asp:ListItem>--%>
                    <asp:ListItem Value="11">慈溪学习公告</asp:ListItem>
                    <asp:ListItem Value="22">慈溪图片新闻</asp:ListItem>
                    <asp:ListItem Value="55">慈溪时政新闻</asp:ListItem>
                    <%--<asp:ListItem Value="44">悬浮窗口</asp:ListItem>--%>
                    <asp:ListItem Value="101">巴马社区快讯</asp:ListItem>
                    <asp:ListItem Value="102">巴马最新公告</asp:ListItem>
                    <asp:ListItem Value="103">巴马图片新闻</asp:ListItem>
                    <asp:ListItem Value="104">巴马时政新闻</asp:ListItem>
                </asp:DropDownList>
                <input type="submit" id="Submit1" runat="server" value=" " class="SearchButton" onserverclick="btnSearch_ServerClick" />
                </td>
            </tr>
        </table>
    </div>
    <div class="searchpanelfooter"></div>
</div>

<div style="overflow:auto;">
    <!--paneltitle-->
    <div class="paneltitle">新闻列表<asp:Literal ID="ltNewsCount" runat="server"></asp:Literal></div>
    <!--paneladd-->
    <div class="paneladd"><img src="<%=ResolveThemeImagePath("icon_add.gif")%>" width="15" height="15" border="0" alt="" align="absmiddle" />&nbsp;<a href="AddNews.aspx">添加新闻</a></div>
</div>
<!--DataList-->
<div class="DG" id="dv_list" runat="server">
	<table cellspacing="0" >
    	<tr>
       	  <th width="8%">序号</th>
          <th width="*">标题</th>
          <th width="10%">创建人</th>
          <th width="11%">所属部门</th>
          <th width="12%">添加时间</th>
          <th width="7%">状态</th>
          <th width="10%">审核状态</th>
          <th width="8%">类型</th>
          <th width="18%">操作</th>
        </tr>
        <asp:Repeater ID="rpt_News" runat="server"  OnItemCommand="Item_Change" OnItemDataBound="Item_Bound">
            <ItemTemplate>
                <tr onmouseover="this.className='tdmover';" onmouseout="this.className='tdmout';">
        	        <td><%# Container.ItemIndex + 1%></td>
        	        <td><span title="<%# Eval("Title").ToString().Replace("<br>", "") %>"><%# Expo.Training.BRule.PublicFunction.SubString(Eval("Title").ToString().Replace("&nbsp;", "").Replace("<br>", ""),38,true)%></td>
                    <td><span title="<%# "用户名：" + Expo.Training.BRule.Member.Member.GetMemberBasicInfo(new Guid(Eval("Creator").ToString()), "UserAccount")%>"><%# Expo.Training.BRule.Member.Member.GetMemberBasicInfo(new Guid(Eval("Creator").ToString()),"RealName")%></span></td>
                    <td><%#Eval("DepartmentName")%></td>
                    <td><%# Expo.Training.BRule.PublicFunction.GetTime(Convert.ToDateTime(Eval("AddTime")),"short")%></td>
                    <td><%# Convert.ToInt32(Eval("Status")) == 1 ? "发布" : "隐藏"%></td>
                    <td><%# GetAudit(Eval("Status"), Eval("IsPass"))%></td>
                    <td><%# GetNewsType(Eval("Type").ToString()) %></td>
                    <td>
                        <asp:HiddenField ID="hid_Creator" Value='<%# Eval("Creator")%>' runat="server" />
                        <a href="ViewNews.aspx?id=<%#Eval("NID") %>" class="detailBtn_2" title="预览"><img src="<%=ResolveThemeImagePath("default.gif") %>" alt="预览" /></a>
                        <asp:HyperLink runat="server" ID="btn_Edit" CssClass="editButton" NavigateUrl='<%# Eval("NID", "EditNews.aspx?ID={0}") %>' ></asp:HyperLink>
                        <asp:Button ID="btn_Delete" runat="server" CssClass="deleteButton" CommandName="delete" CommandArgument='<%# Eval("NID")%>'/>
                        <input title="评论查看" type="button" id="btn_coment" style="display:none;" class="commentButton" onclick="javascript:location.href='Comment.aspx?id=<%#Eval("NID")%>'" />
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater> 
    </table>
</div>
<div id="divShow" runat="server">
    <asp:linkbutton id="lbtGoPageDown" Runat="server" text="" OnClick="lbtGoPageDown_Click"/>
    <div class="p_page">
        <div class="right">
            <span>总记录&nbsp;<asp:Literal ID="ltlTotalThreadDown" runat="server" /></span>
            <span>共&nbsp;<asp:Literal ID="ltlTotalPageDown" runat="server" />&nbsp;页</span>
            <Box:DPager id="PagerDown" OnIndexChanged="PagerDown_IndexChanged" isgomode="false" isnumbermode="true" pagesize="10" runat="server"></Box:DPager>
            <div id="divGoPageDown" class="p_pagein" runat="server"><input name="txtGoPageDown" id="txtGoPageDown" type="text" size="2" maxlength="4" title="输入跳转页码回车" runat="server" /></div>
        </div>
    </div>
</div>
<div style="padding-top:5px;" id="dv_NoResult" runat="server" visible="false" class="importantinfo">
    没有相关记录，请重新搜索！
</div>
<script type="text/javascript">
    jQuery(document).ready(function(){
            jQuery("#<%= txt_BeginDate.ClientID %>").datepicker({
			        changeMonth: true,
			        changeYear: true
		        });
	        jQuery("#<%= txt_BeginDate.ClientID %>").datepicker('option', {dateFormat: "yy-mm-dd"});
        	
            jQuery("#<%= txt_EndDate.ClientID %>").datepicker({
			        changeMonth: true,
			        changeYear: true
		        });
	        jQuery("#<%= txt_EndDate.ClientID %>").datepicker('option', {dateFormat: "yy-mm-dd"}); 
        });
</script>
</asp:Content>

